//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CQuat {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CQuat(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CQuat obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CQuat(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static CQuat getIdentity() {
    long cPtr = nelmiscJNI.CQuat_Identity_get();
    return (cPtr == 0) ? null : new CQuat(cPtr, false);
  }

  public CQuat assign(SWIGTYPE_p_NLMISC__CQuatTT_float_t o) {
    return new CQuat(nelmiscJNI.CQuat_assign(swigCPtr, this, SWIGTYPE_p_NLMISC__CQuatTT_float_t.getCPtr(o)), false);
  }

  public CQuat(SWIGTYPE_p_NLMISC__CQuatTT_float_t o) {
    this(nelmiscJNI.new_CQuat__SWIG_0(SWIGTYPE_p_NLMISC__CQuatTT_float_t.getCPtr(o)), true);
  }

  public CQuat() {
    this(nelmiscJNI.new_CQuat__SWIG_1(), true);
  }

  public CQuat(float X, float Y, float Z, float W) {
    this(nelmiscJNI.new_CQuat__SWIG_2(X, Y, Z, W), true);
  }

  public CQuat(CVector axis, float angle) {
    this(nelmiscJNI.new_CQuat__SWIG_3(CVector.getCPtr(axis), axis, angle), true);
  }

  public CQuat(CAngleAxis aa) {
    this(nelmiscJNI.new_CQuat__SWIG_4(CAngleAxis.getCPtr(aa), aa), true);
  }

}
